import React from 'react'
import {Carousel} from 'antd'
import axios from 'axios'
class Main extends React.Component{
	constructor() {
	    super();
		this.state={
			sylunbodata:[]
		}
	}
	componentDidMount(){
		axios.get("aladdin/get_batch_data?codes=[%22sylunbo%22,%22pingou_B%22,%22Home_TopicCase_170505_7%22,%22Home_CategaryNavs_170505_7%22]&province_code=&city_code=&version=&app_channel=wap&plat=wap&access_token=&device_id=cd9bb2f0-7c16-11eb-8cb6-6d080da925d4")
		.then(resp=>{
		this.setState({
			sylunbodata:resp.data.data.sylunbo.datas
		})
	})
	}
	
	render(){
		const contentStyle = {
		  height: '150px',
		  lineHeight: '150px'
		}
		
		return <div>
			 <Carousel autoplay>
			 {
				 this.state.sylunbodata.map((item,index)=>{
				  return <div key={index}>
					<img src={item.image_url} style={contentStyle} />
				 </div>
				})
			  } 
			  </Carousel>
			<h1>这里是首页</h1>
		</div>
	}
}
export default Main;